:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  /* 亮色主题优化 */
  --app-bg-color: #f5f7fa;
  --app-card-bg: rgba(255, 255, 255, 0.8);
  --app-border-color: #e4e7ed;
  --app-text-primary: #303133;
  --app-text-regular: #606266;
  --app-text-secondary: #909399;

  /* 高级阴影效果 */
  --app-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.04);
  --app-shadow-regular: 0 8px 16px rgba(0, 0, 0, 0.06);
  --app-shadow-hover: 0 14px 24px rgba(0, 0, 0, 0.08);
  --app-shadow-card: 0 10px 20px rgba(31, 38, 135, 0.07);

  /* 渐变效果 */
  --app-gradient-primary: linear-gradient(
    135deg,
    var(--el-color-primary),
    var(--el-color-primary-light-3)
  );
  --app-gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  --app-gradient-title: linear-gradient(45deg, var(--el-color-primary), #6ac2ff);
  --app-gradient-divider: linear-gradient(
    90deg,
    transparent,
    var(--el-color-primary-light-5),
    transparent
  );
  --app-gradient-button: linear-gradient(
    135deg,
    var(--el-color-primary),
    var(--el-color-primary-light-3)
  );
  --app-gradient-hover: linear-gradient(
    135deg,
    var(--el-color-primary-light-3),
    var(--el-color-primary)
  );

  /* 排版优化 */
  --app-font-size-xs: 12px;
  --app-font-size-sm: 13px;
  --app-font-size-base: 14px;
  --app-font-size-md: 16px;
  --app-font-size-lg: 18px;
  --app-font-size-xl: 20px;
  --app-font-size-xxl: 24px;

  /* 行高优化 */
  --app-line-height-compact: 1.3;
  --app-line-height-normal: 1.5;
  --app-line-height-relaxed: 1.8;

  /* 字间距 */
  --app-letter-spacing-tight: -0.01em;
  --app-letter-spacing-normal: 0;
  --app-letter-spacing-wide: 0.01em;

  /* 间距优化 */
  --app-spacing-xs: 4px;
  --app-spacing-sm: 8px;
  --app-spacing-md: 12px;
  --app-spacing-base: 16px;
  --app-spacing-lg: 20px;
  --app-spacing-xl: 24px;
  --app-spacing-xxl: 32px;

  /* 内边距 */
  --app-padding-card: 16px;
  --app-padding-container: 20px;
  --app-padding-section: 24px;

  /* 填充物 */
  --app-fill-light: rgba(245, 247, 250, 0.6);
  --app-fill-regular: rgba(236, 245, 255, 0.6);
  --app-primary-light: rgba(64, 158, 255, 0.1);
  --app-primary-regular: rgba(64, 158, 255, 0.2);

  /* 圆角变量 */
  --app-radius-sm: 4px;
  --app-radius-md: 8px;
  --app-radius-lg: 12px;

  /* 过渡动画 */
  --app-transition-fast: all 0.2s ease;
  --app-transition-normal: all 0.3s ease;
  --app-transition-slow: all 0.5s ease;

  color: var(--app-text-regular);
  background-color: var(--app-bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--app-font-size-base);
  letter-spacing: var(--app-letter-spacing-normal);
}

/* ========== 1. 主题定义与变量 ========== */

:root {
  /* 颜色系统 */
  --app-bg-color: #f5f7fa;
  --app-card-bg: rgba(255, 255, 255, 0.8);
  --app-border-color: #e4e7ed;
  --app-text-primary: #303133;
  --app-text-regular: #606266;
  --app-text-secondary: #909399;

  /* 阴影系统 */
  --app-shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.05);
  --app-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --app-shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
  --app-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --app-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* 背景填充 */
  --app-fill-light: rgba(245, 247, 250, 0.6);
  --app-fill-regular: rgba(236, 245, 255, 0.6);
  --app-primary-light: rgba(64, 158, 255, 0.1);
  --app-primary-regular: rgba(64, 158, 255, 0.2);

  /* 圆角 */
  --app-radius-sm: 6px;
  --app-radius-md: 12px;
  --app-radius-lg: 16px;

  /* 渐变 */
  --app-gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
  --app-gradient-button: linear-gradient(135deg, #409eff, #3a8ee6);
  --app-gradient-title: linear-gradient(90deg, #409eff, #36d1dc);

  /* 动画过渡 */
  --app-transition-fast: all 0.2s ease;
  --app-transition-normal: all 0.3s ease;

  /* 间距系统 */
  --app-spacing-xs: 4px;
  --app-spacing-sm: 8px;
  --app-spacing-base: 12px;
  --app-spacing-md: 16px;
  --app-spacing-lg: 20px;
  --app-spacing-xl: 24px;
  --app-spacing-xxl: 32px;

  /* 字体大小 */
  --app-font-size-xs: 12px;
  --app-font-size-sm: 13px;
  --app-font-size-base: 14px;
  --app-font-size-md: 16px;
  --app-font-size-lg: 18px;
  --app-font-size-xl: 20px;
  --app-font-size-xxl: 24px;

  /* 行高 */
  --app-line-height-compact: 1.3;
  --app-line-height-normal: 1.5;
  --app-line-height-relaxed: 1.8;

  /* 字间距 */
  --app-letter-spacing-tight: -0.02em;
  --app-letter-spacing-normal: 0;
  --app-letter-spacing-wide: 0.02em;
}

/* 暗黑模式变量覆盖 */
.dark-mode {
  --app-bg-color: #141414;
  --app-card-bg: rgba(30, 30, 30, 0.8);
  --app-border-color: #363637;
  --app-text-primary: #9ba5b5;
  --app-text-regular: #cfd3dc;
  --app-text-secondary: #a3a6ad;

  --app-shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.2);
  --app-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --app-shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
  --app-fill-light: rgba(45, 50, 58, 0.6);
  --app-fill-regular: rgba(45, 50, 58, 0.8);

  --app-gradient-card: linear-gradient(145deg, rgba(40, 40, 40, 0.8), rgba(30, 30, 30, 0.7));
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: var(--app-text-regular);
  background-color: var(--app-bg-color);
  line-height: var(--app-line-height-normal);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(64, 158, 255, 0.05) 0%, rgba(64, 158, 255, 0) 50%),
    radial-gradient(circle at 80% 70%, rgba(64, 158, 255, 0.05) 0%, rgba(64, 158, 255, 0) 50%),
    repeating-linear-gradient(
      45deg,
      rgba(64, 158, 255, 0.01) 0%,
      rgba(64, 158, 255, 0.01) 1px,
      transparent 1px,
      transparent 10px
    );
  z-index: 2;
}

@keyframes backgroundScroll {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 60px;
  }
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
}

#app {
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 3;
}

/* Element Plus 组件样式优化 */
.el-button {
  border-radius: var(--app-radius-sm);
  font-weight: 500;
  transition: all 0.3s;
  padding: var(--app-spacing-sm) var(--app-spacing-base);
  font-size: var(--app-font-size-base);
  letter-spacing: var(--app-letter-spacing-normal);
  position: relative;
  overflow: hidden;
}

.el-button--primary {
  background: var(--app-gradient-button);
  border: none;
  box-shadow: 0 4px 15px rgba(64, 158, 255, 0.15);
}

.el-button--primary::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg) translateY(-50%);
  animation: buttonShine 5s infinite linear;
  z-index: 1;
}

@keyframes buttonShine {
  0% {
    top: -100%;
    left: -100%;
  }

  100% {
    top: 100%;
    left: 100%;
  }
}

.el-button:not(.is-text):hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-regular);
}

.el-button--primary:hover {
  background: var(--app-gradient-hover);
  box-shadow: 0 8px 25px rgba(64, 158, 255, 0.2);
}

.el-button:active {
  transform: translateY(0);
}

.el-dialog {
  border-radius: var(--app-radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid var(--app-border-color);
  box-shadow: var(--app-shadow-regular);
}

.el-dialog__header {
  padding: var(--app-spacing-base) var(--app-spacing-xl);
  border-bottom: 1px solid var(--app-border-color);
}

.el-dialog__title {
  color: var(--app-text-primary);
  font-weight: 600;
  font-size: var(--app-font-size-lg);
  letter-spacing: var(--app-letter-spacing-tight);
}

.el-dialog__body {
  padding: var(--app-spacing-xl);
  color: var(--app-text-regular);
  font-size: var(--app-font-size-base);
  line-height: var(--app-line-height-normal);
}

.el-dialog__footer {
  padding: var(--app-spacing-base) var(--app-spacing-xl);
  border-top: 1px solid var(--app-border-color);
}

.el-message-box {
  border-radius: var(--app-radius-md);
  background: var(--app-card-bg);
  border: 1px solid var(--app-border-color);
  box-shadow: var(--app-shadow-regular);
  padding: var(--app-spacing-xl);
}

.el-message {
  border-radius: var(--app-radius-sm);
  box-shadow: var(--app-shadow-light);
  padding: var(--app-spacing-sm) var(--app-spacing-base);
}

.el-table {
  background-color: transparent;
  color: var(--app-text-regular);
}

.el-table th {
  background-color: var(--app-fill-light);
  color: var(--app-text-primary);
}

.el-table td {
  border-color: var(--app-border-color);
}

.el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: var(--app-fill-light);
}

/* 暗黑模式 */
html.dark {
  --app-bg-color: #141414;
  --app-card-bg: rgba(30, 30, 30, 0.8);
  --app-border-color: #363637;
  --app-text-primary: #e5eaf3;
  --app-text-regular: #cfd3dc;
  --app-text-secondary: #a3a6ad;

  /* 暗色主题阴影 */
  --app-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.2);
  --app-shadow-regular: 0 8px 16px rgba(0, 0, 0, 0.25);
  --app-shadow-hover: 0 14px 24px rgba(0, 0, 0, 0.3);
  --app-shadow-card: 0 10px 20px rgba(0, 0, 0, 0.25);

  /* 暗色主题渐变 */
  --app-gradient-card: linear-gradient(145deg, rgba(30, 30, 30, 0.9), rgba(30, 30, 30, 0.6));
  --app-gradient-divider: linear-gradient(
    90deg,
    transparent,
    var(--el-color-primary-light-7),
    transparent
  );

  --app-fill-light: rgba(45, 50, 58, 0.6);
  --app-fill-regular: rgba(45, 50, 58, 0.8);
  --app-primary-light: rgba(64, 158, 255, 0.15);
  --app-primary-regular: rgba(64, 158, 255, 0.25);
}

html.dark body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(64, 158, 255, 0.08) 0%, rgba(64, 158, 255, 0) 50%),
    radial-gradient(circle at 80% 70%, rgba(64, 158, 255, 0.08) 0%, rgba(64, 158, 255, 0) 50%),
    repeating-linear-gradient(
      45deg,
      rgba(64, 158, 255, 0.02) 0%,
      rgba(64, 158, 255, 0.02) 1px,
      transparent 1px,
      transparent 10px
    );
}

/* Markdown 表格样式 */
.markdown-table {
  border: 1px solid var(--app-border-color);
  border-collapse: collapse;
  box-shadow: var(--app-shadow-light);
  width: 100%;
  background-color: var(--app-fill-light);
}

.markdown-table th {
  background-color: var(--app-fill-regular);
  padding: 12px;
  border: 1px solid var(--app-border-color);
  color: var(--app-text-primary);
}

.markdown-table td {
  padding: 10px;
  border: 1px solid var(--app-border-color);
  color: var(--app-text-regular);
}


.el-table td {
  background-color: transparent !important;
}

.right-panel.collapsed {
  width: 60px;
}

.right-panel.collapsed .panel-header {
  flex-direction: column;
  align-items: center;
  gap: var(--app-spacing-md);
  padding: var(--app-spacing-md) var(--app-spacing-sm);
}

.right-panel.collapsed .panel-header h2 {
  margin: 0;
  font-size: var(--app-font-size-sm);
  writing-mode: vertical-rl;
  transform: none;
  white-space: nowrap;
}

.right-panel .view-data-btn {
  width: 100%;
  margin-bottom: var(--app-spacing-md);
  transition: var(--app-transition-normal);
}

.right-panel.collapsed .view-data-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--app-spacing-sm) auto;
}

.right-panel.collapsed .view-data-btn span {
  display: none;
}

.right-panel.collapsed .view-data-btn .el-icon {
  margin: 0;
  font-size: var(--app-font-size-md);
}

/* 左右面板共用样式 */
.side-panel {
  overflow: hidden;
  transition: var(--app-transition-normal);
}

/* 左侧面板 */

.left-panel.collapsed {
  width: 60px;
}

.left-panel.collapsed .panel-header {
  flex-direction: column;
  align-items: center;
  gap: var(--app-spacing-md);
  padding: var(--app-spacing-md) var(--app-spacing-sm);
}

.left-panel.collapsed .panel-header h2 {
  margin: 0;
  font-size: var(--app-font-size-sm);
  writing-mode: vertical-rl;
  transform: none;
  white-space: nowrap;
}

.left-panel.collapsed .new-chat-btn {
  margin: 0;
}

/* ========== 9. 工具提示样式 ========== */
.analysis-tooltip {
  --tooltip-bg: rgba(255, 255, 255, 0.98);
  --tooltip-border: rgba(64, 158, 255, 0.2);
  --tooltip-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);

  background: var(--tooltip-bg) !important;
  border: 1px solid var(--tooltip-border) !important;
  box-shadow: var(--tooltip-shadow) !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--el-color-primary) !important;
  border-radius: 6px !important;
  max-width: none !important;
}

.dark-mode .analysis-tooltip {
  --tooltip-bg: rgba(45, 45, 45, 0.98);
  --tooltip-border: rgba(64, 158, 255, 0.3);
  --tooltip-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);

  color: #fff !important;
}

/* 修复 el-popper 样式 */

.dark-mode :deep(.el-popper.is-light .el-popper__arrow::before) {
  background: var(--tooltip-bg) !important;
  border-color: var(--tooltip-border) !important;
}

/* 确保箭头样式正确 */
:deep(.el-popper.is-light .el-popper__arrow::before) {
  width: 8px !important;
  height: 8px !important;
}

/* 添加过渡动画 */
:deep(.el-popper) {
  transition:
    opacity 0.2s,
    transform 0.2s !important;
  background: var(--tooltip-bg) !important;
}

/* 消息状态指示器样式 */
.message-status-indicators {
  margin-bottom: var(--app-spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--app-spacing-sm);
}

.message-text-collapsed {
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.message-text-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
  pointer-events: none;
}

.dark-mode .message-text-collapsed::after {
  background: linear-gradient(to bottom, rgb(221 218 218 / 0%), rgb(49 49 49 / 90%));
}

.message-text {
  transition: max-height 0.3s ease;
}

/* ========== 2. 基础布局和容器 ========== */

/* 应用容器 */
.el-icon {
  margin-right: 0px !important;
}

.app-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--app-text-regular);
  transition: var(--app-transition-normal);
}

/* 主布局 */
.layout-container {
  display: flex;
  flex: 1;
  padding: 0 var(--app-spacing-md) var(--app-spacing-lg);
  overflow: hidden;
}

/* 玻璃效果 */
.glass-effect {
  backdrop-filter: blur(10px);
  box-shadow: var(--app-shadow-card);
  border-radius: var(--app-radius-sm);
  transition: var(--app-transition-normal);
  box-shadow: var(--app-shadow-hover);
}

.glass-effect:hover {
  box-shadow: var(--app-shadow-hover);
}

/* 顶部通栏 */
.app-header {
  padding: var(--app-spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--app-spacing-md) var(--app-spacing-md);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-logo {
  width: 186px;
  height: 60px;
  transform-origin: center;
  transition: all 0.3s ease;
}

.header-logo:hover {
  animation-duration: 3s;
  transform: scale(1.1);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.header-title {
  font-size: var(--app-font-size-xl);
  font-weight: 600;
  margin: 0 0 0 var(--app-spacing-md);
  background: var(--app-gradient-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: var(--app-letter-spacing-tight);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--app-spacing-base);
}

/* 用户头像和按钮 */
.login-button,
.theme-button {
  box-shadow: var(--app-shadow-xs);
  transition: var(--app-transition-normal);
  color: var(--app-text-regular) !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-border-color) !important;
}

.login-button:hover,
.theme-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow-sm);
  color: var(--el-color-primary) !important;
  border-color: var(--el-color-primary) !important;
}

.user-avatar-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid rgba(64, 158, 255, 0.2);
  transition: var(--app-transition-normal);
}

.user-avatar-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(64, 158, 255, 0.25);
  border-color: rgba(64, 158, 255, 0.4);
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  padding: var(--app-spacing-xs) var(--app-spacing-sm);
  text-align: center;
}

.username {
  font-weight: 500;
  font-size: var(--app-font-size-sm);
  margin-bottom: var(--app-spacing-xs);
}

.email {
  font-size: var(--app-font-size-xs);
  color: var(--app-text-secondary);
}

/* 面板头部 */
.panel-header {
  display: flex;
  align-items: center;
  padding: var(--app-spacing-base);
}

.panel-header h2 {
  margin: 0 0 0 var(--app-spacing-md);
  font-size: var(--app-font-size-md);
  font-weight: 600;
  flex: 1;
  color: var(--app-text-primary);
  letter-spacing: var(--app-letter-spacing-tight);
}

/* 面板内容 */
.panel-content {
  padding: var(--app-spacing-md);
  overflow-y: auto;
  flex: 1;
}

/* 历史会话菜单 */
.history-menu {
  flex: 1;
  overflow: auto;
}

.history-menu-list {
  border-right: none;
}

.history-menu-item {
  padding: 0;
  transition: var(--app-transition-normal);
}

.history-menu-item.is-active {
  background: linear-gradient(90deg, rgba(64, 158, 255, 0.1), rgba(64, 158, 255, 0.05)) !important;
}

.menu-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--app-spacing-lg);
  height: 100%;
  width: 100%;
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: var(--app-spacing-sm);
  overflow: hidden;
}

.menu-item-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.menu-item-actions {
  display: flex;
  gap: var(--app-spacing-xs);
  opacity: 0;
  transition: var(--app-transition-normal);
  align-items: center;
  margin-left: var(--app-spacing-sm);
}

.history-menu-item:hover .menu-item-actions {
  opacity: 1;
}

.new-chat-btn {
  transition: var(--app-transition-normal);
}

.new-chat-btn:hover {
  transform: rotate(90deg);
}

/* ========== 4. 聊天界面样式 ========== */

/* 主内容区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--app-shadow-hover);
}

/* 空状态 */
.empty-state {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--app-spacing-xxl);
}

.empty-content {
  max-width: 600px;
  text-align: center;
}

/* 上传页面 */
.upload-page {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 聊天容器 */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.chat-header {
  border: 0px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--app-spacing-base) var(--app-spacing-lg);
  margin-bottom: 2px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: var(--app-spacing-sm);
}

.chat-logo {
  width: 28px;
  height: 28px;
  animation: logo-spin 20s linear infinite;
  transform-origin: center;
  transition: all 0.3s ease;
}

.chat-logo:hover {
  animation-duration: 3s;
  transform: scale(1.1);
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: var(--app-spacing-base);
}

.chat-tip {
  font-size: var(--app-font-size-sm);
  color: var(--app-text-secondary);
}

/* 消息列表 */
.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--app-spacing-md);
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}

.messages-list::-webkit-scrollbar {
  width: 5px;
}

.messages-list::-webkit-scrollbar-thumb {
  background-color: rgba(64, 158, 255, 0.2);
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

.messages-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(64, 158, 255, 0.4);
}

/* 单条消息 */
.message {
  display: flex;
  margin-bottom: var(--app-spacing-xl);
  gap: var(--app-spacing-sm);
}

.message.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.message.system {
  flex-direction: row;
  justify-content: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.message-content {
  max-width: 80%;
  min-width: 35%;
  padding: var(--app-spacing-md) var(--app-spacing-lg);
  position: relative;
  border: 1px solid transparent;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
}

.message-content:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.user .message-content {
  background: linear-gradient(135deg, rgba(64, 158, 255, 0.1), rgba(64, 158, 255, 0.05));
  border-radius: var(--app-radius-lg) var(--app-spacing-xs) var(--app-radius-lg)
    var(--app-radius-lg);
  margin-left: 0px;
  text-align: right;
}

.system .message-content {
  background: var(--app-card-bg);
  border-radius: var(--app-spacing-xs) var(--app-radius-lg) var(--app-radius-lg)
    var(--app-radius-lg);
  margin-left: var(--app-spacing-sm);
  min-width: 90%;
}

.message-text {
  font-size: 14px;
  line-height: var(--app-line-height-relaxed);
  word-break: break-word;
  margin-bottom: var(--app-spacing-xs);
}

.message-footer {
  margin-top: var(--app-spacing-sm);
  display: flex;
  justify-content: space-between;
}

.message-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.message-time {
  font-size: var(--app-font-size-xs);
  opacity: 0.7;
  margin-top: var(--app-spacing-xs);
}

.message-actions {
  display: flex;
  gap: var(--app-spacing-sm);
  opacity: 0;
  transition: var(--app-transition-normal);
}

.message-content:hover .message-actions {
  opacity: 1;
}

.message-action-buttons {
  display: flex;
  gap: 10px;
}

.message-action-button {
  cursor: pointer;
  color: var(--app-text-secondary);
  transition: var(--app-transition-fast);
}

.message-action-button:hover {
  color: var(--el-color-primary);
  transform: translateY(-2px);
}

/* 消息卡片 */
.message-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--app-spacing-base);
  margin-top: var(--app-spacing-md);
}

.message-card {
  flex: 1 1 calc(50% - var(--app-spacing-base));
  min-width: 200px;
  padding: var(--app-spacing-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--app-transition-normal);
}

.message-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-weight: 500;
  font-size: var(--app-font-size-md);
  margin-bottom: var(--app-spacing-sm);
  color: var(--app-text-primary);
}

.card-description {
  font-size: var(--app-font-size-sm);
  color: var(--app-text-regular);
  line-height: var(--app-line-height-normal);
}

.card-feedback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(64, 158, 255, 0.9);
  color: white;
  font-weight: 500;
  gap: var(--app-spacing-sm);
}

/* 聊天底部 */
.chat-bottom {
  margin-top: auto;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* 分析方向容器 */
.quick-actions-container {
  position: relative;
  display: flex;
  align-items: center;
  margin: var(--app-spacing-sm) var(--app-spacing-lg);
}

/* 分析方向区域 */
.quick-actions {
  display: flex;
  gap: var(--app-spacing-base);
  padding: 6px 2px;
  border-radius: var(--app-radius-sm);
  position: relative;
  scroll-behavior: smooth;
  z-index: 998;
  padding-bottom: 10px;
  padding-top: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  flex: 1;

  /* 改进的滚动条样式 */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--el-color-primary-rgb), 0.3) transparent;
}

.quick-actions::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.quick-actions::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
  margin: 0 10px;
}

.quick-actions::-webkit-scrollbar-thumb {
  background: rgba(var(--el-color-primary-rgb), 0.3);
  border-radius: 3px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 0.3s ease;
}

.quick-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--el-color-primary-rgb), 0.5);
  border: 1px solid transparent;
}

.dark-mode .quick-actions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark-mode .quick-actions::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 滚动按钮样式 */
.scroll-button {
  flex-shrink: 0;
  width: 32px !important;
  height: 32px !important;
  color: var(--app-text-regular);
  background: rgba(var(--el-color-primary-rgb), 0.1);
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 999;
  margin: 0 6px;
  transition: all 0.3s ease;
}

.scroll-button:hover {
  background: rgba(var(--el-color-primary-rgb), 0.2);
  color: var(--el-color-primary);
  transform: translateY(-1px);
}

.scroll-button:active {
  transform: translateY(0);
}

.dark-mode .scroll-button {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.dark-mode .scroll-button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 1);
}

/* ========== 7. 加载和动画效果 ========== */

/* Loading dots */
.loading-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--el-color-primary);
  font-weight: 500;
}

.loading-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.7;
  animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

/* 动画 */
.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: all 0.5s;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateY(-20px);
}

/* 页面切换效果 */
.page-transition-enter-active,
.page-transition-leave-active {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-enter-from {
  opacity: 0;
  transform: scale(0.95) translateY(30px);
  filter: blur(5px);
}

.page-transition-leave-to {
  opacity: 0;
  transform: scale(1.02);
  filter: blur(5px);
}

.fade-scale-enter-active,
.fade-scale-leave-active {
  transition: all 0.3s;
}

.fade-scale-enter-from,
.fade-scale-leave-to {
  opacity: 0;
  transform: scale(0.9);
}

@keyframes buttonShine {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes loading-dots {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
}

@keyframes backgroundScroll {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 60px;
  }
}

/* ========== 8. 组件集成样式 ========== */

/* 上传组件样式 */
:deep(.el-upload-dragger) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(250, 250, 250, 0.8));
  border: 1px solid rgba(64, 158, 255, 0.2);
  transition: var(--app-transition-normal);
  border-radius: var(--app-radius-md);
  padding: var(--app-spacing-lg);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

:deep(.el-upload-dragger:hover) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(245, 249, 254, 0.9));
  border-color: var(--el-color-primary);
  transform: translateY(-2px);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.8),
    0 8px 15px rgba(0, 0, 0, 0.05);
}

:deep(.el-upload-dragger .el-icon) {
  color: var(--el-color-primary);
  font-size: 48px;
  margin-bottom: var(--app-spacing-md);
  filter: drop-shadow(0 2px 5px rgba(64, 158, 255, 0.2));
  transition: var(--app-transition-normal);
}

:deep(.el-upload-dragger:hover .el-icon) {
  transform: scale(1.1);
  filter: drop-shadow(0 4px 8px rgba(64, 158, 255, 0.3));
}

.dark-mode :deep(.el-upload-dragger) {
  background: linear-gradient(145deg, rgba(45, 45, 45, 0.9), rgba(35, 35, 35, 0.8));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-mode :deep(.el-upload-dragger:hover) {
  background: linear-gradient(145deg, rgba(50, 50, 50, 0.95), rgba(40, 40, 40, 0.85));
  border-color: var(--el-color-primary);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.08),
    0 8px 15px rgba(0, 0, 0, 0.3);
}

/* 其他元素样式 */
.el-icon {
  margin-right: 0 !important;
}

.dark-mode .history-menu-item {
  color: #cfd3dc !important;
  background-color: #2a2a2a;
}

.dark-mode .chat-input {
  color: #e5eaf3 !important;
}

.user-avatar-wrapper,
.theme-button {
  width: 36px !important;
  height: 36px !important;
}

.message-content {
  padding: var(--app-spacing-sm) var(--app-spacing-md) !important;
  line-height: var(--app-line-height-compact) !important;
}

/* ========== 5. 输入区域样式 ========== */

.input-area {
  display: flex;
  height: 52px;
  margin: var(--app-spacing-sm) var(--app-spacing-lg) var(--app-spacing-lg);
  overflow: hidden;
  box-shadow: var(--app-shadow-sm);
  position: relative;
  width: auto;
  box-sizing: border-box;
  min-height: 52px;
  max-height: 52px;
}

.chat-input {
  flex: 1;
  font-size: var(--app-font-size-md);
  padding: 0px;
  height: 100%;
  border: none;
  outline: none;
  transition: box-shadow 0.3s ease;
  box-sizing: border-box;
}

.chat-input:focus {
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 输入框样式调整，跟随主题变化 */
:deep(.el-input__wrapper) {
  background-color: var(--app-card-bg);
  box-shadow: 0 0 0 1px var(--app-border-color) inset;
  transition: all 0.3s ease;
  border-radius: 0;
}

:deep(.el-input__wrapper:hover) {
  box-shadow: 0 0 0 1px var(--el-color-primary-light-3) inset;
}

:deep(.el-input__wrapper.is-focus) {
  box-shadow: 0 0 0 1px var(--el-color-primary) inset;
}

:deep(.el-input__inner) {
  color: var(--app-text-primary);
  background: transparent;
  font-size: var(--app-font-size-md);
}

.dark-mode :deep(.el-input__wrapper) {
  background-color: rgba(45, 45, 45, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.dark-mode :deep(.el-input__wrapper:hover) {
  box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.4) inset;
}

.dark-mode :deep(.el-input__inner) {
  color: var(--app-text-primary);
}

.dark-mode :deep(.el-input__inner::placeholder) {
  color: rgba(255, 255, 255, 0.3);
}

.send-button {
  width: 52px;
  height: 52px;
  border-radius: 0;
  transition: var(--app-transition-normal);
}

.send-button:hover {
  box-shadow: 0 0 16px rgba(64, 158, 255, 0.4);
  background: rgba(64, 158, 255, 0.9);
}

/* ========== 7. 加载和动画效果 ========== */

/* Loading dots */
.loading-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--el-color-primary);
  font-weight: 500;
}

.loading-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.7;
  animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

/* 动画 */
.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: all 0.5s;
}

.fade-transform-enter-from {
  opacity: 0;
  transform: translateY(20px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateY(-20px);
}

/* 页面切换效果 */
.page-transition-enter-active,
.page-transition-leave-active {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-enter-from {
  opacity: 0;
  transform: scale(0.95) translateY(30px);
  filter: blur(5px);
}

.page-transition-leave-to {
  opacity: 0;
  transform: scale(1.02);
  filter: blur(5px);
}

.fade-scale-enter-active,
.fade-scale-leave-active {
  transition: all 0.3s;
}

.fade-scale-enter-from,
.fade-scale-leave-to {
  opacity: 0;
  transform: scale(0.9);
}

@keyframes buttonShine {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes loading-dots {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
}

@keyframes backgroundScroll {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 60px;
  }
}

/* Element Plus 卡片样式覆盖 */
.el-card {
  background: var(--app-gradient-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--app-border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-radius: var(--app-radius-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.el-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.el-card .el-card__header {
  padding: var(--app-spacing-md);
  border-bottom: 1px solid var(--app-border-color);
  font-weight: 500;
  color: var(--app-text-primary);
}

.el-card .el-card__body {
  padding: var(--app-spacing-md);
  color: var(--app-text-regular);
}

/* 暗色模式下卡片样式 */
.dark-mode .el-card {
  background: rgba(35, 35, 35, 0.8);
  border-color: rgba(80, 80, 80, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode .el-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode .el-card .el-card__header {
  border-bottom-color: rgba(80, 80, 80, 0.3);
  background-color: rgba(0, 0, 0, 0.2);
}

/* 禁用Element Plus卡片的默认hover效果 */
.el-card.is-hover-shadow:hover {
  transform: translateY(-3px);
}
